import request from '@/utils/request'
import Qs from 'qs'

export function listComment(query) {
  return request({
    url: '/comment/list',
    method: 'get',
    params: query
  })
}

export function deleteComment(data) {
  return request({
    url: '/comment/delete',
    method: 'post',
    data
  })
}
// 全部核销列表
export function listWrite(query) {
  return request({
    url: '/wx/findWriteOffed',
    method: 'post',
    params: query

  })
}
// 条件查询核销列表
export function findById(query) {
  return request({
    url: '/wx/findById',
    method: 'post',
    params: query

  })
}
// 核销
export function wxWriteOff(query) {
  return request({
    url: '/wx/wxWriteOff',
    method: 'get',
    params: query

  })
}
// 查询短信
export function listMessage(query) {
  return request({
    url: '/messageMould/list',
    method: 'get',
    params: query

  })
}
// 修改短信
export function updatemessage(data) {
  return request({
    url: '/messageMould/edit',
    method: 'post',
    params: data
  })
}
//查询邮件
export function listmail(query) {
  return request({
    url: '/messageMould/list',
    method: 'get',
    params: query

  })
}
//修改评论状态
export function editCommentStatus(data) {
  return request({
    url: '/comment/editStatus',
    method: 'post',
    data
  })
}

export function addComments(data) {
  return request({
    url: '/comment/addComments',
    method: 'post',
    data
  })
}

export function getGoods(query) {
  return request({
    url: '/comment/getGoods',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
